package other_其他模式.DAO_data_access_object_数据访问对象模式;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/10/11:01
 * @Description:
 */
public class Student {

	private int id;

	private String name;

	public Student(int id, String name) {
		this.id = id;
		this.name = name;
	}

	public Student() {
	}

	@Override public String toString() {
		return "Student{" +
				"id=" + id +
				", name='" + name + '\'' +
				'}';
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	@Override public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Student)) {
			return false;
		}
		Student student = (Student) o;
		return id == student.id &&
				Objects.equals(name, student.name);
	}

	@Override public int hashCode() {
		return Objects.hash(id, name);
	}
}
